package com.payment.service.impl;

import com.payment.request.TransRequest;
import com.payment.service.IPayService;
import com.payment.service.TransService;
import com.payment.trans.AbstractTrans;
import com.payment.util.TransCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class PayServiceImpl implements IPayService {

    @Autowired
    private TransService transService;

    @Override
    public void pay(TransRequest transRequest) {
        AbstractTrans abstractTrans = transService.getTrans(TransCodeEnum.TRANS_PAY.getCode());
        abstractTrans.execute(transRequest);
    }
}
